﻿using System;
using System.Text;
using Microsoft.Practices.RecipeFramework;
using Microsoft.Practices.RecipeFramework.Library;
using EnvDTE;
using EnvDTE80;

namespace EEst.SoftwareFactory.ValueProviders
{
    public class EnvDTEValueProvider : ValueProvider
    {
        public override bool OnBeginRecipe(object currentValue, out object newValue)
        {
            if (currentValue != null)
            {
                // Do not assign a new value, and return false to flag that 
                // we don't want the current value to be changed.
                newValue = null;
                return false;
            }

            DTE vs = GetService<DTE>(true);

            newValue = vs;
            return true;
        }
    }
}
